//
//  HHViewController.m
//  Flower
//
//  Created by 花花 on 2016/12/6.
//  Copyright © 2016年 花花. All rights reserved.
//

#import "HHViewController.h"

@interface HHViewController ()<UIScrollViewDelegate>

@end


@implementation HHViewController

extern NSString *const HHParentTableViewDidLeaveFromTopNotification;
- (void)viewDidLoad {
    [super viewDidLoad];
        self.automaticallyAdjustsScrollViewInsets = NO;
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(leaveFromTop) name:HHParentTableViewDidLeaveFromTopNotification object:nil];

}

-(void)leaveFromTop{

    _scrollView.contentOffset = CGPointZero;

}

-(void)scrollViewDidScroll:(UIScrollView *)scrollView{

    if (!_scrollView ) {
        _scrollView = scrollView;
    }
    
    if (self.delegate &&[self.delegate respondsToSelector:@selector(scrollViewIsScrolling:)]) {
        [self.delegate scrollViewIsScrolling:scrollView];
    }

}
-(void)dealloc{

    [[NSNotificationCenter defaultCenter] removeObserver:self];

}

@end
